# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs
pkgver=3.9.1
# shellcheck disable=SC2034 # used for git versions, keep around for next time
_ver=${pkgver%_git*}
pkgrel=0
pkgdesc="Tool to generate initramfs images for Alpine"
url="https://gitlab.alpinelinux.org/alpine/mkinitfs"
arch="all"
license="GPL-2.0-only"
makedepends_host="busybox kmod-dev util-linux-dev cryptsetup-dev linux-headers"
makedepends="$makedepends_host"
checkdepends="kyua"
depends="
	apk-tools>=2.9.1
	busybox-binsh
	busybox>=1.28.2-r1
	kmod
	lddtree>=1.25
	mdev-conf
	"
subpackages="$pkgname-doc"
install="$pkgname.pre-upgrade $pkgname.post-install $pkgname.post-upgrade"
triggers="$pkgname.trigger=/lib/modules/*"
source="https://gitlab.alpinelinux.org/alpine/mkinitfs/-/archive/$pkgver/mkinitfs-$pkgver.tar.gz
	"

provides="initramfs-generator"
provider_priority=900 # highest

build() {
	make VERSION=$pkgver-r$pkgrel
}

check() {
	make check
}

package() {
	make install DESTDIR="$pkgdir"
}

sha512sums="
217ae1353dad9bf5e5c7ebb25f281c80493c2bad16fe99aa079a30a9196918ac39fd02c54d59de19f338e07f93f9297945d621d32a6d802f0f01d93df89398d1  mkinitfs-3.9.1.tar.gz
"
